/*
 * @Author: 卓伊凡
 * @LastEditors: 卓伊凡
 * @email: 422108995@qq.com
 * @github: https://github.com/youyacao
 * @gitee: https://gitee.com/youyacao/
 * @Date: 2025-02-07 01:45:21
 * @LastEditTime: 2025-02-07 02:01:18
 * @motto: Still water runs deep
 * @Description: 优雅草科技卓伊凡-优雅草科技主程-兼技术总监-优雅草科技欢迎合作共赢，优雅草科技官网www.youyacao.com，感谢合作与支持，请仔细阅读优雅草科技的开源lisence文件，您可以百分百100%使用优雅草的开源产品，但是需要遵守相关规则，并且需要申明是使用了优雅草科技的产品
 * @FilePath: \ff-flutter\lib\screens\short_videos\widgets\video_player.dart
 */
import 'package:flutter/material.dart';
import 'package:reels_viewer/reels_viewer.dart';

class VideoPlayer extends StatelessWidget {
  final List<ReelModel> reelsList = [
    ReelModel(
      'https://qingtingcun.youyacao.com/qiniu_202412161352557053526366.mp4',
      'User Name',
      likeCount: 2000,
      isLiked: false,
      musicName: 'Original Sound',
      reelDescription: "Life is better when you're laughing.",
      profileUrl: 'assets/images/default_avatar.png',
      commentList: [
        ReelCommentModel(
          comment: 'Great video!',
          userProfilePic: 'assets/images/default_avatar.png',
          userName: 'User1',
          commentTime: DateTime.now(),
        ),
      ],
    ),

  ReelModel(
      'https://qingtingcun.youyacao.com/qiniu_202412131631475035420898.mp4',
      'User Name',
      likeCount: 2000,
      isLiked: false,
      musicName: 'Original Sound',
      reelDescription: "Life is better when you're laughing.",
      profileUrl: 'assets/images/default_avatar.png',
      commentList: [
        ReelCommentModel(
          comment: 'Great video!',
          userProfilePic: 'assets/images/default_avatar.png',
          userName: 'User1',
          commentTime: DateTime.now(),
        ),
      ],
    ),


  ReelModel(
      'https://qingtingcun.youyacao.com/qiniu_202412101650559518816779.mp4',
      'User Name',
      likeCount: 2000,
      isLiked: false,
      musicName: 'Original Sound',
      reelDescription: "Life is better when you're laughing.",
      profileUrl: 'assets/images/default_avatar.png',
      commentList: [
        ReelCommentModel(
          comment: 'Great video!',
          userProfilePic: 'assets/images/default_avatar.png',
          userName: 'User1',
          commentTime: DateTime.now(),
        ),
      ],
    ),

  ReelModel(
      'https://qingtingcun.youyacao.com/qiniu_202410102318222033965464.mp4',
      'User Name',
      likeCount: 2000,
      isLiked: false,
      musicName: 'Original Sound',
      reelDescription: "Life is better when you're laughing.",
      profileUrl: 'assets/images/default_avatar.png',
      commentList: [
        ReelCommentModel(
          comment: 'Great video!',
          userProfilePic: 'assets/images/default_avatar.png',
          userName: 'User1',
          commentTime: DateTime.now(),
        ),
      ],
    ),


  ReelModel(
      'https://qingtingcun.youyacao.com/qiniu_202410102059392386214226.mp4',
      'User Name',
      likeCount: 2000,
      isLiked: false,
      musicName: 'Original Sound',
      reelDescription: "Life is better when you're laughing.",
      profileUrl: 'assets/images/default_avatar.png',
      commentList: [
        ReelCommentModel(
          comment: 'Great video!',
          userProfilePic: 'assets/images/default_avatar.png',
          userName: 'User1',
          commentTime: DateTime.now(),
        ),
      ],
    ),









    // 可以添加更多视频
  ];

  @override
  Widget build(BuildContext context) {
    return ReelsViewer(
      reelsList: reelsList,
      showProgressIndicator: true,
      showVerifiedTick: false,
      showAppbar: false,
      onShare: (url) {
        debugPrint('Shared reel url: $url');
      },
      onLike: (url) {
        debugPrint('Liked reel url: $url');
      },
      onFollow: () {
        debugPrint('Followed user');
      },
      onComment: (comment) {
        debugPrint('New comment: $comment');
      },
      onClickMoreBtn: () {
        debugPrint('Clicked more options');
      },
      onClickBackArrow: () {
        debugPrint('Clicked back arrow');
      },
      onIndexChanged: (index) {
        debugPrint('Current video index: $index');
      },
    );
  }
}
